package com.xzy.mapper;

import com.xzy.custom.Page;
import com.xzy.entities.BookInformation;
import com.xzy.entities.BookRepertory;
import com.xzy.web.form.BookRepertoryForm;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * TODO
 *
 * @author XiangZhongyi
 * ClassName: BookRepertoryMapper
 * date: 2022/1/23 11:50
 */
@Repository
public interface BookRepertoryMapper {

    Integer findBookRepertoryCount(@Param("page") Page page,@Param("name") String name);

    List<BookRepertory> findBookRepertory(@Param("page") Page page,@Param("name") String name);

    BookRepertory findById(@Param("id")Integer id);

    void updateById(@Param("form") BookRepertoryForm form);

    void insertRepertory(@Param("form") BookRepertoryForm form);

    void deleteById(@Param("parseInt") int parseInt);

    void deleteByBookId(@Param("parseInt") int parseInt);

    BookRepertory findByBookId(@Param("bookId") Integer bookId);

    void updateByBookId(@Param("bookRepertory") BookRepertory bookRepertory,@Param("bookId") Integer bookId);

    void updateQuantity(@Param("quantity") Integer quantity,@Param("bookId") Integer bookId);
}
